﻿using Adnc.Application.Shared.Dtos;
using Adnc.Application.Shared.Interceptors;
using Adnc.Application.Shared.Services;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using WYT.Usr.Application.Contracts.Dtos.Warehouse;

namespace WYT.Usr.Application.Contracts.Services
{
    /// <summary>
    /// 云仓服务
    /// </summary>
    public interface IWarehouseAppService : IAppService
    {
        /// <summary>
        /// 库存管理
        /// </summary>
        /// <param name="orderId">订单ID</param>
        /// <returns></returns>
        [UnitOfWork]
        Task<AppSrvResult<bool>> InventoryManagement(long orderId);

        /// <summary>
        /// 获取云仓出库记录列表
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<AppSrvResult<PageModelDto<WarehouseLogDto>>> GetUserWarehouseLogList(long userId, WarehouseLogSearchDto input);

        /// <summary>
        /// 获取用户云仓商品总的数量
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<AppSrvResult<int>> GetUserWarehouseCount(long userId);

        /// <summary>
        /// 获取用户云仓商品列表
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="input"></param>
        /// <returns></returns>
        Task<AppSrvResult<List<WarehouseDto>>> GetUserWarehouse(long userId, SearchDto input);

        /// <summary>
        /// 分类获取云仓商品数量
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="language"></param>
        /// <returns></returns>
        Task<AppSrvResult<List<WarehouseClassificationDto>>> ClassificationGetUserWarehouse(long userId, string language);

        /// <summary>
        /// 获取用户云仓中商品数量
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        Task<AppSrvResult<List<WarehouseSimpleDto>>> GetWarehouseSimplesAsync(long userId);

        /// <summary>
        /// 订单收货后处理
        /// </summary>
        /// <param name="orderId"></param>
        /// <returns></returns>
        [UnitOfWork]
        Task<AppSrvResult> OrderReceivingHandle(long orderId);
    }
}
